package cn.net.autocode.platform.table;

import cn.net.autocode.core.bean.ResultT;
import cn.net.autocode.dbManager.Dao;
import com.alibaba.fastjson2.JSONArray;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/platform/tableAdd")
@RestController("platformTableAdd")
public class TableAdd {

    private final Dao dictDao;

    public TableAdd(@Qualifier("dictDao") Dao dictDao) {
        this.dictDao = dictDao;
    }

    @RequestMapping("tableCategory")
    public ResultT tableCategory(){
        JSONArray array = dictDao.queryJSONArray("select * from ac_table_category order by code");
        return ResultT.success(array);
    }
}
